package com.practice.share.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.practice.share.basemapper.SameService;
import com.practice.share.mapper.NoticeMessageMapper;
import com.practice.share.model.pojo.NoticeMessage;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class NoticeOperationServiceImpl extends SameService<NoticeMessage> {

    @Resource
    private NoticeMessageMapper noticeMessageMapper;

    public PageInfo<NoticeMessage> getAllNoticeById(Integer userId, Integer pageNumber) {
        PageHelper.startPage(pageNumber, 15);
        return new PageInfo<NoticeMessage>(noticeMessageMapper.getAllNoticeById(userId));
    }
}
